//
//  BGMTextView.m
//  BGM
//
//  Created by liuqin on 2018/11/27.
//  Copyright © 2018年 com.alirtc.demo. All rights reserved.
//

#import "BGMTextView.h"
#import "Common.h"

@implementation BGMTextView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self != nil) {
  
        self.backgroundColor = bgmColor(244, 244, 244);
        self.layer.cornerRadius = 25;
        self.layer.masksToBounds = YES;
        
        self.iconImage = [[UIImageView alloc]initWithFrame:CGRectMake(15, 15, 20, 20)];
        [self addSubview:self.iconImage];
        
        self.myText = [[UITextField alloc]initWithFrame:CGRectMake(45, 0, SCREENW-70, frame.size.height)];
        [self addSubview:self.myText];
        
        self.rightBtn = [[UIButton alloc]initWithFrame:CGRectMake(frame.size.width-100, 0, 100, frame.size.height)];
        [self.rightBtn setTitleColor:bgmgrayColor forState:UIControlStateNormal];
        [self.rightBtn setBackgroundColor:bgmColor(224, 224, 224)];
        self.rightBtn.hidden = YES;
        [self addSubview:self.rightBtn];
        [self.rightBtn addTarget:self action:@selector(clickBtn) forControlEvents:UIControlEventTouchUpInside];
        
        self.myLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.rightBtn.frame.origin.x, self.rightBtn.frame.origin.y, 100, self.rightBtn.frame.size.height)];
        self.myLabel.textColor = bgmgrayColor;
        [self addSubview:self.myLabel];
        self.myLabel.text = @"60s";
        self.myLabel.hidden = YES;
        
    }
    return self;
}
- (void)clickBtn{
    [self.delegate getCoreNumber];

}
 
@end
